﻿using System;

namespace IComparableTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Number[] numbers = GetNumber();//定义一个Number数组方法
            SortNumbers(numbers);//定义一个方法

              

        }

        static void SortNumbers(Number[] numbers)
        {

            Array.Sort(numbers);//对nunbers数组进行排序
            foreach (Number n in numbers)//foueach循环遍历每一个numbers
            {
                Console.WriteLine(n);//输出n
            }
        }


        static Number[] GetNumber()
        {
            //throw new NotImplementedException();
            return new Number[] {
             new Number { Name = "田", Numb = 4 },
             new Number { Name = "敢", Numb = 2 },
             new Number { Name = "憨", Numb = 6 },
             new Number { Name = "言", Numb = 3 },
             new Number { Name = "富", Numb = 1 },
             new Number { Name = "枫", Numb = 5 }

            };

        }
    }
}
